package com.rsscollector.model.vo;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "NEWS_GROUP")
public class NewsGroup implements Serializable {
	private Long id;

	private Collection<RssContent> news = new HashSet<RssContent>();

	public NewsGroup() {
		// empty
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "NEWS_GROUP_ID")
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@OneToMany(mappedBy = "group")
	public Collection<RssContent> getNews() {
		return this.news;
	}

	public void setNews(Collection<RssContent> news) {
		this.news = news;
	}
}